package com.chapter12.self_define_exception;


public class renew_self_exception {
    public static void main(String[] args) {
        int age = 40;
        try {
            if (!((age >= 18) && (age <= 25))) {
                throw new overwrite("你的年龄貌似有些大了");
            }
        } catch (overwrite e) {
            System.out.println(e.getMessage());;
        }
    }
}


class overwrite extends RuntimeException {
    public overwrite(String message) {
        super(message);
    }
}
